Skip to content

Conversation

@coot
Copy link
Collaborator

@coot coot commented Oct 29, 2025

Fixes #230

@coot coot requested a review from Copilot October 29, 2025 19:50
@coot coot enabled auto-merge October 29, 2025 19:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in traceResult to allow asynchronous exceptions from QuickCheck operators (within, discardAfter) to pass through without being caught. The fix ensures that IOSim simulations can be properly terminated by QuickCheck's timeout mechanisms.

Key changes:

  • Modified traceResult to filter asynchronous exceptions using tryJust and fromException
  • Added -fno-full-laziness GHC option to the test module to prevent GHC from optimizing away lambda wrapping
  • Added two unit tests (unit_discardAfter and unit_within) to verify the fix works correctly

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
io-sim/src/Control/Monad/IOSim.hs Modified traceResult to let asynchronous exceptions pass through, added import for SomeAsyncException
io-sim/test/Test/Control/Monad/IOSim.hs Added GHC compiler flag and two unit tests to verify QuickCheck timeout operators work correctly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coot coot force-pushed the coot/io-sim-exception-handling branch 3 times, most recently from f0fad1c to fe2b46b Compare October 29, 2025 20:02
@coot coot self-assigned this Oct 30, 2025
@coot coot changed the title Exception handling in traceResult io-sim: exception handling in traceResult Oct 30, 2025
@coot coot force-pushed the coot/io-sim-exception-handling branch from fe2b46b to ce080af Compare October 30, 2025 11:25
Copy link

@crocodile-dentist crocodile-dentist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@coot coot added this pull request to the merge queue Oct 31, 2025
Merged via the queue into main with commit 5683864 Oct 31, 2025
14 checks passed
@coot coot deleted the coot/io-sim-exception-handling branch October 31, 2025 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IOSim interferes with QuickCheck exception handling

3 participants